Skip to content

Artifacts "when" conditions support - #1885

Open
anprowh wants to merge 1 commit into
firecow:masterfrom
anprowh:allow-on-failure-artifacts
Open

Artifacts "when" conditions support#1885
anprowh wants to merge 1 commit into
firecow:masterfrom
anprowh:allow-on-failure-artifacts

Conversation

@anprowh

@anprowh anprowh commented Jun 18, 2026

Copy link
Copy Markdown

Fix copyArtifactsOut condition to support different artifacts.when field values.


Summary by cubic

Update copyArtifactsOut to honor artifacts.when values (on_success, on_failure, never) so artifacts are exported only when the job status matches the setting. Defaults/always continue to export as before.

Written for commit a165501. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

Comment thread src/job.ts
private async copyArtifactsOut (writeStreams: WriteStreams, expanded: {[key: string]: string}) {
// TODO: update the condition to support when:on_success / when:on_failure
if (this.jobStatus !== "success" && this.artifacts?.when !== "always") return;
if (this.jobStatus !== "success" && this.artifacts?.when === "on_success") return;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regression: absent when = on_success in gitlab, so a failed job now uploads. need when ?? on_success + treat warning as failure.

@firecow

firecow commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Add some tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants